/// <reference path="./gateway.d.ts" />
import { HttpRequestUtil } from "../tools/httpRequestOrder";
/**获取OpenId或者自动登录 */
export function wxGetOpenIdOrLogin(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/sso/wxGetOpenIdOrLogin", params);
}
/**微信自动注册与登录 */
export function wxAutoRegistAndLogin(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.post<IGatewayAPI.Result.IsInitSuccess>("api/sso/wxAutoRegistAndLogin", params);
}
/** 获取通通锁token */
export function getToken(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/getToken");
}

/** 酒店分页列表查询 */
export function hotelPage(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/hotelPage", params);
}
/** 根据酒店查询房间信息 */
export function getRoomByHotelId(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/getRoomByHotelId/" + params.hotelId);
}
/** 生成房间二维码 */
export function getRoomRcCode(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/getRoomRcCode" , params);
}


/** 根据锁id查询绑定的房间 */
export function getRoomInfoByLockId(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/hotelbase/msHotelBase/getRoomInfoByLockId/" + params.lockId);
}
/** 根据锁id查询锁详情 */
export function getLockDetail(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/ttLock/getLockDetail/" + params.lockId);
}

/** 锁绑定房间 */
export function bindRoomWithLock(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.post<IGatewayAPI.Result.IsInitSuccess>("/api/hotelbase/msHotelBase/bindRoomWithLock", params);
}
/** 查询房间 */
export function allRoom(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/allRoom", params);
}
/** 根据房间id查询房间详情 */
export function getRoomById(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("/api/hotelRealCheck/getRoomById/" + params.roomId);
}

/** 初始化锁 */
export function ttLockInit(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.post<IGatewayAPI.Result.IsInitSuccess>("/api/ttLock/initLock", params);
}


/** 管理员登录*/
export function classicLogin(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.post<IGatewayAPI.Result.IsInitSuccess>("/api/sso/classicLogin", params);
}

/** 管理员查酒店信息 */
export function msHotelBase(params: IGatewayAPI.Params.IsInitSuccess) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("/hotelbase/msHotelBase/list", params);
}


/** 提交订单 */
export function placeOrder(params) {
  console.log('0000', params)
  return HttpRequestUtil.post<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/placeOrder", params);
}

/** 实名认证 */
export function hotelRealCheck(params) {
  return HttpRequestUtil.post<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/safeCheck/" + params.checkType, params);
}

/** 我的订单 */
export function myOrder(params) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/myOrder", params);
}

/** 开锁 */
export function openAble(params) {
  return HttpRequestUtil.get<IGatewayAPI.Result.IsInitSuccess>("api/hotelRealCheck/openAble/" + params, params);
}